import React from "react";
import { Link } from "react-router-dom";
import '../styles/footer.less';
import { FooterInterface } from "./interface/FooterInterface";

export default class Footer extends React.Component<FooterInterface>
{
    constructor(props: any){
        super(props);
        this.state = {}
    }

    componentDidMount(){
        console.log(this.props.activeName)
    }

    render() {
        return <div className="footer-container">
            <ul>
                <Link to="/home">
                <li className={this.props.activeName === 'home' ? 'active' : ''}>首页</li>
                </Link>
                <Link to="/category">
                <li className={this.props.activeName === 'category' ? 'active' : ''}>分类</li>
                </Link>
                <Link to="/cart">
                <li className={this.props.activeName === 'cart' ? 'active' : ''}>购物车</li>
                </Link>
                <Link to="/my">
                <li className={this.props.activeName === 'my' ? 'active' : ''}>我的</li>
                </Link>
            </ul>
        </div>;
    }
}